package com.test.kotlin04

fun listTest(){
    val list:List<String> = listOf("Jason","jack","jacky")
//    println(list[3])//越界
    println(list.getOrElse(4){"Unknown"})
    println(list.getOrNull(4))
    println(list.getOrNull(4)?:"Unknown")
}


fun main(){
    listTest()
}